//
//  NCBTImage.h
//  BaiduTravel
//
//  Created by neu on 11-9-10.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NCBTImage : UIImageView {
#ifdef NCBTImageHasWaiting
	UIActivityIndicatorView *_loadingWheel;
    UIImageView             *_waitingImageView;
    NSString *_waitingImageName;
    BOOL _centerWaiting;
#endif
    UIImageView             *_realImageView;
	NSInvocation* _onImageTap;
	
    // YES to drop the touch event,not to send to it`s parent.
    BOOL _dropTouchEvent;
	
	// Tap callback delegate and selector.
	id _delegate;
	SEL _selector;
    
    // download delegate and selector
    id _downloadDelegate;
	SEL _downloadSelector;
    NSString *_url;
    float   _border;
    UIImage *_image;
    
    // hold whether has downloaded
    BOOL _isDownloaded;

    // to set if to show the orginal picture;
    BOOL _isShowOriginDownloadPic;

}

@property (nonatomic) BOOL dropTouchEvent;
@property (nonatomic, retain) NSString  *url;
@property (nonatomic, retain) NSString  *bgImageName;
@property (nonatomic)           float   border;
@property (nonatomic, retain) UIImage   *image;
@property (nonatomic) BOOL isDownloaded;
@property (nonatomic) BOOL isShowOriginDownloadPic;

#ifdef NCBTImageHasWaiting
@property (nonatomic) BOOL centerWaiting;
@property (nonatomic, retain) NSString   *waitingImageName;
#endif

- (id)initWithFrame:(CGRect)frame URL:(NSString*)URL;
- (void)setCallbackOnDownloadFinished:(id)delegate withSelector:(SEL)selector;
- (void)setCallbackOnImageTap:(id)delegate withSelector:(SEL)selector;
- (void)setUrl:(NSString*)aUrl;
- (void)setBgImageName:(NSString*)aImageName;
// - (void)setFrame:(CGRect)aFrame;

#ifdef NCBTImageHasWaiting
- (void)setWaitingImageName:(NSString*)aWaitingImageName;
#endif
- (void) setDownLoadOrginPic:(UIImage *)aImage;
- (void)downloadFinished;
@end
